import request from '@/utils/request';
import type { ResBody } from './common';

interface UploadedInfo {
  url: string;
  fileName: string;
  ossId: string;
}

export const upload = (file: File): ResBody<UploadedInfo> => {
  const form = new FormData();
  form.append('file', file);
  return request.post('/resource/oss/upload', form);
};
